﻿package Message.Public
{
    import Framework.MQ.*;
    import Framework.Serialize.*;
    import flash.utils.*;

    public class SGroup extends IMessageBase
    {
        public var name:String;
        public var groupId:SEntityId;
        public var captainId:SEntityId;
        public var players:Array;
        public var memberInvite:Boolean;
        public var autoEnter:Boolean;
        public var combatLimit:int;
        public var password:String;
        public var copyCode:int;
        public var copyNums:Dictionary;
        public const _type:int = 4000;
        public static var _regist:SGroup = new SGroup(true);

        public function SGroup(param1:Boolean = false)
        {
            if (param1)
            {
                MessageManager.instance().regist(this);
            }
            return;
        }// end function

        override public function getType() : int
        {
            return this._type;
        }// end function

        override public function clone() : IMessageBase
        {
            return new SGroup();
        }// end function

        override public function __write(param1:SerializeStream) : void
        {
            param1.writeString(this.name);
            this.groupId.__write(param1);
            this.captainId.__write(param1);
            SeqGroupPlayerHelper.write(param1, this.players);
            param1.writeBool(this.memberInvite);
            param1.writeBool(this.autoEnter);
            param1.writeInt(this.combatLimit);
            param1.writeString(this.password);
            param1.writeInt(this.copyCode);
            DictEntityIdIntHelper.write(param1, this.copyNums);
            return;
        }// end function

        override public function __read(param1:SerializeStream) : void
        {
            this.name = param1.readString();
            this.groupId = new SEntityId();
            this.groupId.__read(param1);
            this.captainId = new SEntityId();
            this.captainId.__read(param1);
            this.players = SeqGroupPlayerHelper.read(param1);
            this.memberInvite = param1.readBool();
            this.autoEnter = param1.readBool();
            this.combatLimit = param1.readInt();
            this.password = param1.readString();
            this.copyCode = param1.readInt();
            this.copyNums = DictEntityIdIntHelper.read(param1);
            return;
        }// end function

    }
}
